package com.jx.lcs.messagepush.service;

import java.util.HashSet;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.jx.lcs.messagepush.dao.UserMessageDao;
import com.jx.lcs.messagepush.entity.UserMessage;
import com.tianyu.jty.common.persistence.HibernateDao;
import com.tianyu.jty.common.service.BaseService;

@Service
@Transactional(readOnly = true)
public class UserMessageService  extends BaseService<UserMessage, String> {

	@Autowired
	private UserMessageDao userMessageDao;

	@Override
	public HibernateDao<UserMessage, String> getEntityDao() {
		// TODO Auto-generated method stub
		return userMessageDao;
	}
	
	
	/**
	 * 获取未阅读数量
	 * @param uid
	 * @return
	 */
	public List getUnReadMsgCount(){
		
		return userMessageDao.getUnReadMsgCount();
	}
	
	public void batchSave(HashSet<UserMessage>  userMessageSet){
		
		userMessageDao.batchSave(userMessageSet);

	}
}
